﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using F10101CM.Control;
using F1010DB.CustomEntity;
using F1010DB.CustomEntity.InitDanhMuc;
using F1010DB.SecurityServices;
namespace HDVN_F1_101.Common
{
    public partial class frmHeThongDanhMuc : Form
    {
        private PopulateToComboBox populate;
        private InitLoadDataServices init = new InitLoadDataServices();
        private Dictionary<string, string> l = null;
        //private DataGridViewColumns define = null;

        public frmHeThongDanhMuc()
        {
            InitializeComponent();
        }

        private void frmHeThongDanhMuc_Load(object sender, EventArgs e)
        {
            l = init.defineNameLabelList();
            //cboDanhMuc.DataSource = l.ToArray();
           
            for(int i = 0; i < l.Keys.Count; i++)
            {
                cboDanhMuc.Items.Insert(i, l[l.Keys.ToArray()[i]]);
            }
        }

        private void btnThoat_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void cboDanhMuc_SelectedIndexChanged(object sender, EventArgs e)
        {
            int index = cboDanhMuc.SelectedIndex;
            string tableName = l.Keys.ToArray()[index];

            dataGridView1.DataSource = InitDisplayLoad.listDanhMuc[tableName];
            dataGridView1.AutoResizeColumns();
        }

        private void populateToDataGridView(string listName)
        {

        }

        private void danhMucNganhHuongDaoVietNamData()
        {
            
        }
        
    }
}
